package cc.yugu.yhdw.common.protocol.msg03;

import cc.yugu.yhdw.common.protocol.MsgCode;
import cc.yugu.yhdw.common.protocol.msg05.Msg051000010;
import cc.yugu.yhdw.common.tool.netty.TypeOperator;
import io.netty.buffer.ByteBuf;

import java.util.ArrayList;
import java.util.List;

public class Msg031000009 extends Msg031 {

    public List<Msg051000010.Box> boxs = new ArrayList<Msg051000010.Box>();

    @Override
    public int getMsgCode() {
        return MsgCode.MSG_031000009.getCode();
    }


    @Override
    public void writeData(ByteBuf buffer) {
        buffer.writeInt(boxs.size());
        for(Msg051000010.Box e : boxs) {
            e.write(buffer);
        }
    }


    @Override
    public void readData(ByteBuf buffer) {
        int size = buffer.readInt();
        for (int i = 0; i < size; i++) {
            Msg051000010.Box box = new Msg051000010.Box();
            box.read(buffer);
            boxs.add(box);
        }
    }

}
